<!doctype html>
<html>
<head>
  <title>Learning javascript</title>
  <meta charset="utf-8" />
  <meta http-equiv="Content-type" content="text/html; charset=utf-8" />
  <meta name="viewport" content="width=device-width, initial-scale=1" />
  <style>
  </style>
</head>
<body>
<div>
  <p id="arrayString"></p>
  <script type="text/javascript"> 
//     for (var i = 1; i < 5; i=i+1) {
//      alert(i);
//    }
    var arrayString="";
    var myArray=["pizza","chocolate","chips"];
    for (var i=0; i < myArray.length; i=i+1) {
      arrayString=arrayString+myArray[i];
    }
    document.getElementById("arrayString").innerHTML=arrayString;
  </script>
</div>
</body>
</html>
